﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo06
{
    class Program
    {
        enum dd
        {
            新订单,
            已发货,
            已签收,
            已评价
        }

        enum Fruit
        {
            香蕉,
            苹果,
            西瓜,
            草莓,
            葡萄,
            哈密瓜,
            奇异果
        }

        enum RPG
        {
            战士,
            法师,
            精灵
        }


        static void Main(string[] args)
        {
            game();
            Console.ReadKey();
            StringUtil.Test2();
            Console.ReadKey();
            ArrayUtil.Test();
            Console.ReadKey();

            int sum = 0;
            int max = 0;
            int min = 0;
            int avg = 0;
            Sz(ref max, ref min, ref avg);
            Console.ReadKey();
            Sz2(out max, out min, out avg);
            Console.ReadKey();
            Console.ForegroundColor = ConsoleColor.Red;
            Student student = new Student("孙悟空");
            Student student1 = new Student("沙和尚");
            Student student2 = new Student("猪八戒");
            Student student3 = new Student("白龙马");
            student.print();
            Console.ForegroundColor = ConsoleColor.Yellow;
            student1.print();
            Console.ForegroundColor = ConsoleColor.Blue;
            student2.print();
            Console.ForegroundColor = ConsoleColor.White;
            student3.print();
            Console.ForegroundColor = ConsoleColor.Red;
            Student.ceteacher();
            student.print();
            Console.ForegroundColor = ConsoleColor.Yellow;
            student1.print();
            Console.ForegroundColor = ConsoleColor.Blue;
            student2.print();
            Console.ForegroundColor = ConsoleColor.White;
            student3.print();
            Console.ReadKey();
        }



        public static int Sz(ref int max, ref int min, ref int avg)
        {
            int[] a = new int[5];
            int sum = 0;
            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine("请输入第{0}个数据", (i + 1));
                int b = int.Parse(Console.ReadLine());
                a[i] = b;
                sum = sum + a[i];
            }

            Array.Sort(a);
            max = a[4];
            min = a[0];
            avg = sum / 5;
            Console.WriteLine("和是{0}，最大值是{1}，最小值是{2}，平均值是{3}", sum, max, min, avg);
            return sum;
        }
        public static int Sz2(out int max, out int min, out int avg)
        {
            int[] a = new int[5];
            int sum = 0;
            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine("请输入第{0}个数据", (i + 1));
                int b = int.Parse(Console.ReadLine());
                a[i] = b;
                sum = sum + a[i];
            }
            Array.Sort(a);
            max = a[4];
            min = a[0];
            avg = sum / 5;
            Console.WriteLine("和是{0}，最大值是{1}，最小值是{2}，平均值是{3}", sum, max, min, avg);
            return sum;
        }
    }
    }
        public static void Class2()
        {
            dd a = dd.已发货;
            Console.WriteLine(a);
            dd b = dd.已签收;
            Console.WriteLine(b);
            dd c = dd.已评价;
            Console.WriteLine(c);
            dd d = dd.新订单;
            Console.WriteLine(d);
        }
        public static void qsg()
        {
            string a;
            for (int i = 0; i <= 7; i++)
            {
                Console.WriteLine("请切水果" + (a = Console.ReadLine()));
                if (a == "香蕉")
                {
                    Fruit a1 = Fruit.香蕉;
                    Console.WriteLine("得分是{0}", (int)a1);
                }
                else if (a == "苹果")
                {
                    Fruit a2 = Fruit.苹果;
                    Console.WriteLine("得分是{0}", (int)a2);
                }
                else if (a == "西瓜")
                {
                    Fruit a3 = Fruit.西瓜;
                    Console.WriteLine("得分是{0}", (int)a3);
                }
                else if (a == "草莓")
                {
                    Fruit a4 = Fruit.草莓;
                    Console.WriteLine("得分是{0}", (int)a4);
                }
                else if (a == "葡萄")
                {
                    Fruit a5 = Fruit.葡萄;
                    Console.WriteLine("得分是{0}", (int)a5);
                }
                else if (a == "哈密瓜")
                {
                    Fruit a6 = Fruit.哈密瓜;
                    Console.WriteLine("得分是{0}", (int)a6);
                }
                else if (a == "奇异果")
                {
                    Fruit a7 = Fruit.奇异果;
                    Console.WriteLine("得分是{0}", (int)a7);
                }
                else
                {
                    Console.WriteLine("输入有误请重新输入");
                    qsg();
                }
            }
        }
        public static void game()
        {
            for (int i = 0; i <= 3; i++)
            {
                int a;
                Console.WriteLine("请输入技能值");
                a = int.Parse(Console.ReadLine());
                if (a == 0)
                {
                    RPG a1 = RPG.战士;
                    Console.WriteLine("碎石打击、烈焰锚钩、战斗咆哮");
                }
                else if (a == 1)
                {
                    RPG a2 = RPG.法师;
                    Console.WriteLine("巨浪冲击、元素突击、复仇杀戮");
                }
                else if (a == 2)
                {
                    RPG a3 = RPG.精灵;
                    Console.WriteLine("减速陷阱、能量浪潮、旋风剑舞");
                }
                else
                {
                    Console.WriteLine("输入有误，请重新输入0 到 2 的技能值");
                    game();
                }
            }
        }

      }
}
